package com.ruoyi.ziran.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ziran.mapper.ZrExerciseMapper;
import com.ruoyi.ziran.domain.ZrExercise;
import com.ruoyi.ziran.service.IZrExerciseService;
import com.ruoyi.common.core.text.Convert;

/**
 * 演习通知Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-29
 */
@Service
public class ZrExerciseServiceImpl implements IZrExerciseService 
{
    @Autowired
    private ZrExerciseMapper zrExerciseMapper;

    /**
     * 查询演习通知
     * 
     * @param id 演习通知主键
     * @return 演习通知
     */
    @Override
    public ZrExercise selectZrExerciseById(Long id)
    {
        return zrExerciseMapper.selectZrExerciseById(id);
    }

    /**
     * 查询演习通知列表
     * 
     * @param zrExercise 演习通知
     * @return 演习通知
     */
    @Override
    public List<ZrExercise> selectZrExerciseList(ZrExercise zrExercise)
    {
        return zrExerciseMapper.selectZrExerciseList(zrExercise);
    }

    /**
     * 新增演习通知
     * 
     * @param zrExercise 演习通知
     * @return 结果
     */
    @Override
    public int insertZrExercise(ZrExercise zrExercise)
    {
        zrExercise.setCreateTime(DateUtils.getNowDate());
        return zrExerciseMapper.insertZrExercise(zrExercise);
    }

    /**
     * 修改演习通知
     * 
     * @param zrExercise 演习通知
     * @return 结果
     */
    @Override
    public int updateZrExercise(ZrExercise zrExercise)
    {
        zrExercise.setUpdateTime(DateUtils.getNowDate());
        return zrExerciseMapper.updateZrExercise(zrExercise);
    }

    /**
     * 批量删除演习通知
     * 
     * @param ids 需要删除的演习通知主键
     * @return 结果
     */
    @Override
    public int deleteZrExerciseByIds(String ids)
    {
        return zrExerciseMapper.deleteZrExerciseByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除演习通知信息
     * 
     * @param id 演习通知主键
     * @return 结果
     */
    @Override
    public int deleteZrExerciseById(Long id)
    {
        return zrExerciseMapper.deleteZrExerciseById(id);
    }
}
